#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/4/17 23:19
# @Author  : Grayson Liu
# @Email   : graysonliu@foxmail.com
# @File    : config.py
import os
import sys

BASEDIR = os.path.abspath(os.path.dirname(__file__))


class Config:
    JSON_AS_ASCII = False
    SECRET_KEY = b'_5#y2L"F4Q8z\n\xec]/'
    DEBUG = True

    # 初始化SQLite数据库
    if sys.platform.startswith('win'):  # 如果是 Windows 系统，使用三个斜线
        prefix = 'sqlite:///'
    else:  # 否则使用四个斜线
        prefix = 'sqlite:////'
    SQLALCHEMY_DATABASE_URI = prefix + os.path.join(BASEDIR, "data.db")
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 关闭对模型修改的监控

    DATABASE = "db/user.db"

